package com.lsmo.android.common.base;

import android.app.Activity;
import android.content.Context;
import android.view.ContextMenu;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.ProgressBar;

import com.lsmo.android.carfans.R;

public class BaseView extends LinearLayout implements ViewProcessCallBack {

    protected Context mContext ;
    private ProgressBar mPb ;
  
    
	public BaseView(Context context) {
		super(context);
		this.mContext = context ;
		// TODO Auto-generated constructor stub

		 ((LayoutInflater)context.getSystemService(Activity.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.blank_layout, this);	
		 mPb = (ProgressBar)this.findViewById(R.id.loading_pb);
  	

	}

	
	
	@Override
	public void processAfterTaskFinish(int code, Object result ) {
		// TODO Auto-generated method stub
		
 
		this.mPb.setVisibility(View.GONE);
		 
		
	}
	
	
	
	 

	@Override
	public void updateView() {
		// TODO Auto-generated method stub
		
		this.mPb.setVisibility(View.VISIBLE);
		// if(!isFirstRun){
			//	isFirstRun = true ;
				new BaseTask(0,
						this.mContext,
						this 
			 ).execute(new String[]{});
		  // }
	}

	
	@Override
	protected void onCreateContextMenu(ContextMenu menu) {
		// TODO Auto-generated method stub
		super.onCreateContextMenu(menu);
		
	}

 

 

}
